home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / tcl / tclUnixStr.c < prev    next >
C/C++ Source or Header  |  1993-02-14  |  15KB  |  721 lines

  1. /* 
  2.  * tclUnixStr.c --
  3.  *
  4.  *    This file contains procedures that generate strings
  5.  *    corresponding to various UNIX-related codes, such
  6.  *    as errno and signals.
  7.  *
  8.  * Copyright 1991 Regents of the University of California
  9.  * Permission to use, copy, modify, and distribute this
  10.  * software and its documentation for any purpose and without
  11.  * fee is hereby granted, provided that this copyright
  12.  * notice appears in all copies.  The University of California
  13.  * makes no representations about the suitability of this
  14.  * software for any purpose.  It is provided "as is" without
  15.  * express or implied warranty.
  16.  */
  17.  
  18. #include "tclInt.h"
  19. #include "tclUnix.h"
  20.  
  21. /*
  22.  *----------------------------------------------------------------------
  23.  *
  24.  * Tcl_ErrnoId --
  25.  *
  26.  *    Return a textual identifier for the current errno value.
  27.  *
  28.  * Results:
  29.  *    This procedure returns a machine-readable textual identifier
  30.  *    that corresponds to the current errno value (e.g. "EPERM").
  31.  *    The identifier is the same as the #define name in errno.h.
  32.  *
  33.  * Side effects:
  34.  *    None.
  35.  *
  36.  *----------------------------------------------------------------------
  37.  */
  38.  
  39. char *
  40. Tcl_ErrnoId()
  41. {
  42.     switch (errno) {
  43. #ifdef E2BIG
  44.     case E2BIG: return "E2BIG";
  45. #endif
  46. #ifdef EACCES
  47.     case EACCES: return "EACCES";
  48. #endif
  49. #ifdef EADDRINUSE
  50.     case EADDRINUSE: return "EADDRINUSE";
  51. #endif
  52. #ifdef EADDRNOTAVAIL
  53.     case EADDRNOTAVAIL: return "EADDRNOTAVAIL";
  54. #endif
  55. #ifdef EADV
  56.     case EADV: return "EADV";
  57. #endif
  58. #ifdef EAFNOSUPPORT
  59.     case EAFNOSUPPORT: return "EAFNOSUPPORT";
  60. #endif
  61. #ifdef EAGAIN
  62.     case EAGAIN: return "EAGAIN";
  63. #endif
  64. #ifdef EALIGN
  65.     case EALIGN: return "EALIGN";
  66. #endif
  67. #ifdef EALREADY
  68.     case EALREADY: return "EALREADY";
  69. #endif
  70. #ifdef EBADE
  71.     case EBADE: return "EBADE";
  72. #endif
  73. #ifdef EBADF
  74.     case EBADF: return "EBADF";
  75. #endif
  76. #ifdef EBADFD
  77.     case EBADFD: return "EBADFD";
  78. #endif
  79. #ifdef EBADMSG
  80.     case EBADMSG: return "EBADMSG";
  81. #endif
  82. #ifdef EBADR
  83.     case EBADR: return "EBADR";
  84. #endif
  85. #ifdef EBADRPC
  86.     case EBADRPC: return "EBADRPC";
  87. #endif
  88. #ifdef EBADRQC
  89.     case EBADRQC: return "EBADRQC";
  90. #endif
  91. #ifdef EBADSLT
  92.     case EBADSLT: return "EBADSLT";
  93. #endif
  94. #ifdef EBFONT
  95.     case EBFONT: return "EBFONT";
  96. #endif
  97. #ifdef EBUSY
  98.     case EBUSY: return "EBUSY";
  99. #endif
  100. #ifdef ECHILD
  101.     case ECHILD: return "ECHILD";
  102. #endif
  103. #ifdef ECHRNG
  104.     case ECHRNG: return "ECHRNG";
  105. #endif
  106. #ifdef ECOMM
  107.     case ECOMM: return "ECOMM";
  108. #endif
  109. #ifdef ECONNABORTED
  110.     case ECONNABORTED: return "ECONNABORTED";
  111. #endif
  112. #ifdef ECONNREFUSED
  113.     case ECONNREFUSED: return "ECONNREFUSED";
  114. #endif
  115. #ifdef ECONNRESET
  116.     case ECONNRESET: return "ECONNRESET";
  117. #endif
  118. #if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK))
  119.     case EDEADLK: return "EDEADLK";
  120. #endif
  121. #ifdef EDEADLOCK
  122.     case EDEADLOCK: return "EDEADLOCK";
  123. #endif
  124. #ifdef EDESTADDRREQ
  125.     case EDESTADDRREQ: return "EDESTADDRREQ";
  126. #endif
  127. #ifdef EDIRTY
  128.     case EDIRTY: return "EDIRTY";
  129. #endif
  130. #ifdef EDOM
  131.     case EDOM: return "EDOM";
  132. #endif
  133. #ifdef EDOTDOT
  134.     case EDOTDOT: return "EDOTDOT";
  135. #endif
  136. #ifdef EDQUOT
  137.     case EDQUOT: return "EDQUOT";
  138. #endif
  139. #ifdef EDUPPKG
  140.     case EDUPPKG: return "EDUPPKG";
  141. #endif
  142. #ifdef EEXIST
  143.     case EEXIST: return "EEXIST";
  144. #endif
  145. #ifdef EFAULT
  146.     case EFAULT: return "EFAULT";
  147. #endif
  148. #ifdef EFBIG
  149.     case EFBIG: return "EFBIG";
  150. #endif
  151. #ifdef EHOSTDOWN
  152.     case EHOSTDOWN: return "EHOSTDOWN";
  153. #endif
  154. #ifdef EHOSTUNREACH
  155.     case EHOSTUNREACH: return "EHOSTUNREACH";
  156. #endif
  157. #ifdef EIDRM
  158.     case EIDRM: return "EIDRM";
  159. #endif
  160. #ifdef EINIT
  161.     case EINIT: return "EINIT";
  162. #endif
  163. #ifdef EINPROGRESS
  164.     case EINPROGRESS: return "EINPROGRESS";
  165. #endif
  166. #ifdef EINTR
  167.     case EINTR: return "EINTR";
  168. #endif
  169. #ifdef EINVAL
  170.     case EINVAL: return "EINVAL";
  171. #endif
  172. #ifdef EIO
  173.     case EIO: return "EIO";
  174. #endif
  175. #ifdef EISCONN
  176.     case EISCONN: return "EISCONN";
  177. #endif
  178. #ifdef EISDIR
  179.     case EISDIR: return "EISDIR";
  180. #endif
  181. #ifdef EISNAME
  182.     case EISNAM: return "EISNAM";
  183. #endif
  184. #ifdef ELBIN
  185.     case ELBIN: return "ELBIN";
  186. #endif
  187. #ifdef EL2HLT
  188.     case EL2HLT: return "EL2HLT";
  189. #endif
  190. #ifdef EL2NSYNC
  191.     case EL2NSYNC: return "EL2NSYNC";
  192. #endif
  193. #ifdef EL3HLT
  194.     case EL3HLT: return "EL3HLT";
  195. #endif
  196. #ifdef EL3RST
  197.     case EL3RST: return "EL3RST";
  198. #endif
  199. #ifdef ELIBACC
  200.     case ELIBACC: return "ELIBACC";
  201. #endif
  202. #ifdef ELIBBAD
  203.     case ELIBBAD: return "ELIBBAD";
  204. #endif
  205. #ifdef ELIBEXEC
  206.     case ELIBEXEC: return "ELIBEXEC";
  207. #endif
  208. #ifdef ELIBMAX
  209.     case ELIBMAX: return "ELIBMAX";
  210. #endif
  211. #ifdef ELIBSCN
  212.     case ELIBSCN: return "ELIBSCN";
  213. #endif
  214. #ifdef ELNRNG
  215.     case ELNRNG: return "ELNRNG";
  216. #endif
  217. #ifdef ELOOP
  218.     case ELOOP: return "ELOOP";
  219. #endif
  220. #ifdef EMFILE
  221.     case EMFILE: return "EMFILE";
  222. #endif
  223. #ifdef EMLINK
  224.     case EMLINK: return "EMLINK";
  225. #endif
  226. #ifdef EMSGSIZE
  227.     case EMSGSIZE: return "EMSGSIZE";
  228. #endif
  229. #ifdef EMULTIHOP
  230.     case EMULTIHOP: return "EMULTIHOP";
  231. #endif
  232. #ifdef ENAMETOOLONG
  233.     case ENAMETOOLONG: return "ENAMETOOLONG";
  234. #endif
  235. #ifdef ENAVAIL
  236.     case ENAVAIL: return "ENAVAIL";
  237. #endif
  238. #ifdef ENET
  239.     case ENET: return "ENET";
  240. #endif
  241. #ifdef ENETDOWN
  242.     case ENETDOWN: return "ENETDOWN";
  243. #endif
  244. #ifdef ENETRESET
  245.     case ENETRESET: return "ENETRESET";
  246. #endif
  247. #ifdef ENETUNREACH
  248.     case ENETUNREACH: return "ENETUNREACH";
  249. #endif
  250. #ifdef ENFILE
  251.     case ENFILE: return "ENFILE";
  252. #endif
  253. #ifdef ENOANO
  254.     case ENOANO: return "ENOANO";
  255. #endif
  256. #if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR))
  257.     case ENOBUFS: return "ENOBUFS";
  258. #endif
  259. #ifdef ENOCSI
  260.     case ENOCSI: return "ENOCSI";
  261. #endif
  262. #ifdef ENODATA
  263.     case ENODATA: return "ENODATA";
  264. #endif
  265. #ifdef ENODEV
  266.     case ENODEV: return "ENODEV";
  267. #endif
  268. #ifdef ENOENT
  269.     case ENOENT: return "ENOENT";
  270. #endif
  271. #ifdef ENOEXEC
  272.     case ENOEXEC: return "ENOEXEC";
  273. #endif
  274. #ifdef ENOLCK
  275.     case ENOLCK: return "ENOLCK";
  276. #endif
  277. #ifdef ENOLINK
  278.     case ENOLINK: return "ENOLINK";
  279. #endif
  280. #ifdef ENOMEM
  281.     case ENOMEM: return "ENOMEM";
  282. #endif
  283. #ifdef ENOMSG
  284.     case ENOMSG: return "ENOMSG";
  285. #endif
  286. #ifdef ENONET
  287.     case ENONET: return "ENONET";
  288. #endif
  289. #ifdef ENOPKG
  290.     case ENOPKG: return "ENOPKG";
  291. #endif
  292. #ifdef ENOPROTOOPT
  293.     case ENOPROTOOPT: return "ENOPROTOOPT";
  294. #endif
  295. #ifdef ENOSPC
  296.     case ENOSPC: return "ENOSPC";
  297. #endif
  298. #ifdef ENOSR
  299.     case ENOSR: return "ENOSR";
  300. #endif
  301. #ifdef ENOSTR
  302.     case ENOSTR: return "ENOSTR";
  303. #endif
  304. #ifdef ENOSYM
  305.     case ENOSYM: return "ENOSYM";
  306. #endif
  307. #ifdef ENOSYS
  308.     case ENOSYS: return "ENOSYS";
  309. #endif
  310. #ifdef ENOTBLK
  311.     case ENOTBLK: return "ENOTBLK";
  312. #endif
  313. #ifdef ENOTCONN
  314.     case ENOTCONN: return "ENOTCONN";
  315. #endif
  316. #ifdef ENOTDIR
  317.     case ENOTDIR: return "ENOTDIR";
  318. #endif
  319. #if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST))
  320.     case ENOTEMPTY: return "ENOTEMPTY";
  321. #endif
  322. #ifdef ENOTNAM
  323.     case ENOTNAM: return "ENOTNAM";
  324. #endif
  325. #ifdef ENOTSOCK
  326.     case ENOTSOCK: return "ENOTSOCK";
  327. #endif
  328. #ifdef ENOTTY
  329.     case ENOTTY: return "ENOTTY";
  330. #endif
  331. #ifdef ENOTUNIQ
  332.     case ENOTUNIQ: return "ENOTUNIQ";
  333. #endif
  334. #ifdef ENXIO
  335.     case ENXIO: return "ENXIO";
  336. #endif
  337. #ifdef EOPNOTSUPP
  338.     case EOPNOTSUPP: return "EOPNOTSUPP";
  339. #endif
  340. #ifdef EPERM
  341.     case EPERM: return "EPERM";
  342. #endif
  343. #ifdef EPFNOSUPPORT
  344.     case EPFNOSUPPORT: return "EPFNOSUPPORT";
  345. #endif
  346. #ifdef EPIPE
  347.     case EPIPE: return "EPIPE";
  348. #endif
  349. #ifdef EPROCLIM
  350.     case EPROCLIM: return "EPROCLIM";
  351. #endif
  352. #ifdef EPROCUNAVAIL
  353.     case EPROCUNAVAIL: return "EPROCUNAVAIL";
  354. #endif
  355. #ifdef EPROGMISMATCH
  356.     case EPROGMISMATCH: return "EPROGMISMATCH";
  357. #endif
  358. #ifdef EPROGUNAVAIL
  359.     case EPROGUNAVAIL: return "EPROGUNAVAIL";
  360. #endif
  361. #ifdef EPROTO
  362.     case EPROTO: return "EPROTO";
  363. #endif
  364. #ifdef EPROTONOSUPPORT
  365.     case EPROTONOSUPPORT: return "EPROTONOSUPPORT";
  366. #endif
  367. #ifdef EPROTOTYPE
  368.     case EPROTOTYPE: return "EPROTOTYPE";
  369. #endif
  370. #ifdef ERANGE
  371.     case ERANGE: return "ERANGE";
  372. #endif
  373. #if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED))
  374.     case EREFUSED: return "EREFUSED";
  375. #endif
  376. #ifdef EREMCHG
  377.     case EREMCHG: return "EREMCHG";
  378. #endif
  379. #ifdef EREMDEV
  380.     case EREMDEV: return "EREMDEV";
  381. #endif
  382. #ifdef EREMOTE
  383.     case EREMOTE: return "EREMOTE";
  384. #endif
  385. #ifdef EREMOTEIO
  386.     case EREMOTEIO: return "EREMOTEIO";
  387. #endif
  388. #ifdef EREMOTERELEASE
  389.     case EREMOTERELEASE: return "EREMOTERELEASE";
  390. #endif
  391. #ifdef EROFS
  392.     case EROFS: return "EROFS";
  393. #endif
  394. #ifdef ERPCMISMATCH
  395.     case ERPCMISMATCH: return "ERPCMISMATCH";
  396. #endif
  397. #ifdef ERREMOTE
  398.     case ERREMOTE: return "ERREMOTE";
  399. #endif
  400. #ifdef ESHUTDOWN
  401.     case ESHUTDOWN: return "ESHUTDOWN";
  402. #endif
  403. #ifdef ESOCKTNOSUPPORT
  404.     case ESOCKTNOSUPPORT: return "ESOCKTNOSUPPORT";
  405. #endif
  406. #ifdef ESPIPE
  407.     case ESPIPE: return "ESPIPE";
  408. #endif
  409. #ifdef ESRCH
  410.     case ESRCH: return "ESRCH";
  411. #endif
  412. #ifdef ESRMNT
  413.     case ESRMNT: return "ESRMNT";
  414. #endif
  415. #ifdef ESTALE
  416.     case ESTALE: return "ESTALE";
  417. #endif
  418. #ifdef ESUCCESS
  419.     case ESUCCESS: return "ESUCCESS";
  420. #endif
  421. #ifdef ETIME
  422.     case ETIME: return "ETIME";
  423. #endif
  424. #ifdef ETIMEDOUT
  425.     case ETIMEDOUT: return "ETIMEDOUT";
  426. #endif
  427. #ifdef ETOOMANYREFS
  428.     case ETOOMANYREFS: return "ETOOMANYREFS";
  429. #endif
  430. #ifdef ETXTBSY
  431.     case ETXTBSY: return "ETXTBSY";
  432. #endif
  433. #ifdef EUCLEAN
  434.     case EUCLEAN: return "EUCLEAN";
  435. #endif
  436. #ifdef EUNATCH
  437.     case EUNATCH: return "EUNATCH";
  438. #endif
  439. #ifdef EUSERS
  440.     case EUSERS: return "EUSERS";
  441. #endif
  442. #ifdef EVERSION
  443.     case EVERSION: return "EVERSION";
  444. #endif
  445. #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
  446.     case EWOULDBLOCK: return "EWOULDBLOCK";
  447. #endif
  448. #ifdef EXDEV
  449.     case EXDEV: return "EXDEV";
  450. #endif
  451. #ifdef EXFULL
  452.     case EXFULL: return "EXFULL";
  453. #endif
  454.     }
  455.     return "unknown error";
  456. }
  457.  
  458. /*
  459.  *----------------------------------------------------------------------
  460.  *
  461.  * Tcl_SignalId --
  462.  *
  463.  *    Return a textual identifier for a signal number.
  464.  *
  465.  * Results:
  466.  *    This procedure returns a machine-readable textual identifier
  467.  *    that corresponds to sig.  The identifier is the same as the
  468.  *    #define name in signal.h.
  469.  *
  470.  * Side effects:
  471.  *    None.
  472.  *
  473.  *----------------------------------------------------------------------
  474.  */
  475.  
  476. char *
  477. Tcl_SignalId(sig)
  478.     int sig;            /* Number of signal. */
  479. {
  480.     switch (sig) {
  481. #ifdef SIGABRT
  482.     case SIGABRT: return "SIGABRT";
  483. #endif
  484. #ifdef SIGALRM
  485.     case SIGALRM: return "SIGALRM";
  486. #endif
  487. #ifdef SIGBUS
  488.     case SIGBUS: return "SIGBUS";
  489. #endif
  490. #ifdef SIGCHLD
  491.     case SIGCHLD: return "SIGCHLD";
  492. #endif
  493. #if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
  494.     case SIGCLD: return "SIGCLD";
  495. #endif
  496. #ifdef SIGCONT
  497.     case SIGCONT: return "SIGCONT";
  498. #endif
  499. #if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU))
  500.     case SIGEMT: return "SIGEMT";
  501. #endif
  502. #ifdef SIGFPE
  503.     case SIGFPE: return "SIGFPE";
  504. #endif
  505. #ifdef SIGHUP
  506.     case SIGHUP: return "SIGHUP";
  507. #endif
  508. #ifdef SIGILL
  509.     case SIGILL: return "SIGILL";
  510. #endif
  511. #ifdef SIGINT
  512.     case SIGINT: return "SIGINT";
  513. #endif
  514. #ifdef SIGIO
  515.     case SIGIO: return "SIGIO";
  516. #endif
  517. #if defined(SIGIOT) && (!defined(SIGABRT) || (SIGIOT != SIGABRT))
  518.     case SIGIOT: return "SIGIOT";
  519. #endif
  520. #ifdef SIGKILL
  521.     case SIGKILL: return "SIGKILL";
  522. #endif
  523. #if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG))
  524.     case SIGLOST: return "SIGLOST";
  525. #endif
  526. #ifdef SIGPIPE
  527.     case SIGPIPE: return "SIGPIPE";
  528. #endif
  529. #if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
  530.     case SIGPOLL: return "SIGPOLL";
  531. #endif
  532. #ifdef SIGPROF
  533.     case SIGPROF: return "SIGPROF";
  534. #endif
  535. #if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ))
  536.     case SIGPWR: return "SIGPWR";
  537. #endif
  538. #ifdef SIGQUIT
  539.     case SIGQUIT: return "SIGQUIT";
  540. #endif
  541. #ifdef SIGSEGV
  542.     case SIGSEGV: return "SIGSEGV";
  543. #endif
  544. #ifdef SIGSTOP
  545.     case SIGSTOP: return "SIGSTOP";
  546. #endif
  547. #ifdef SIGSYS
  548.     case SIGSYS: return "SIGSYS";
  549. #endif
  550. #ifdef SIGTERM
  551.     case SIGTERM: return "SIGTERM";
  552. #endif
  553. #ifdef SIGTRAP
  554.     case SIGTRAP: return "SIGTRAP";
  555. #endif
  556. #ifdef SIGTSTP
  557.     case SIGTSTP: return "SIGTSTP";
  558. #endif
  559. #ifdef SIGTTIN
  560.     case SIGTTIN: return "SIGTTIN";
  561. #endif
  562. #ifdef SIGTTOU
  563.     case SIGTTOU: return "SIGTTOU";
  564. #endif
  565. #if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO))
  566.     case SIGURG: return "SIGURG";
  567. #endif
  568. #ifdef SIGUSR1
  569.     case SIGUSR1: return "SIGUSR1";
  570. #endif
  571. #ifdef SIGUSR2
  572.     case SIGUSR2: return "SIGUSR2";
  573. #endif
  574. #ifdef SIGVTALRM
  575.     case SIGVTALRM: return "SIGVTALRM";
  576. #endif
  577. #ifdef SIGWINCH
  578.     case SIGWINCH: return "SIGWINCH";
  579. #endif
  580. #ifdef SIGXCPU
  581.     case SIGXCPU: return "SIGXCPU";
  582. #endif
  583. #ifdef SIGXFSZ
  584.     case SIGXFSZ: return "SIGXFSZ";
  585. #endif
  586.     }
  587.     return "unknown signal";
  588. }
  589.  
  590. /*
  591.  *----------------------------------------------------------------------
  592.  *
  593.  * Tcl_SignalMsg --
  594.  *
  595.  *    Return a human-readable message describing a signal.
  596.  *
  597.  * Results:
  598.  *    This procedure returns a string describing sig that should
  599.  *    make sense to a human.  It may not be easy for a machine
  600.  *    to parse.
  601.  *
  602.  * Side effects:
  603.  *    None.
  604.  *
  605.  *----------------------------------------------------------------------
  606.  */
  607.  
  608. char *
  609. Tcl_SignalMsg(sig)
  610.     int sig;            /* Number of signal. */
  611. {
  612.     switch (sig) {
  613. #ifdef SIGABRT
  614.     case SIGABRT: return "SIGABRT";
  615. #endif
  616. #ifdef SIGALRM
  617.     case SIGALRM: return "alarm clock";
  618. #endif
  619. #ifdef SIGBUS
  620.     case SIGBUS: return "bus error";
  621. #endif
  622. #ifdef SIGCHLD
  623.     case SIGCHLD: return "child status changed";
  624. #endif
  625. #if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
  626.     case SIGCLD: return "child status changed";
  627. #endif
  628. #ifdef SIGCONT
  629.     case SIGCONT: return "continue after stop";
  630. #endif
  631. #if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU))
  632.     case SIGEMT: return "EMT instruction";
  633. #endif
  634. #ifdef SIGFPE
  635.     case SIGFPE: return "floating-point exception";
  636. #endif
  637. #ifdef SIGHUP
  638.     case SIGHUP: return "hangup";
  639. #endif
  640. #ifdef SIGILL
  641.     case SIGILL: return "illegal instruction";
  642. #endif
  643. #ifdef SIGINT
  644.     case SIGINT: return "interrupt";
  645. #endif
  646. #ifdef SIGIO
  647.     case SIGIO: return "input/output possible on file";
  648. #endif
  649. #if defined(SIGIOT) && (!defined(SIGABRT) || (SIGABRT != SIGIOT))
  650.     case SIGIOT: return "IOT instruction";
  651. #endif
  652. #ifdef SIGKILL
  653.     case SIGKILL: return "kill signal";
  654. #endif
  655. #if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG))
  656.     case SIGLOST: return "resource lost";
  657. #endif
  658. #ifdef SIGPIPE
  659.     case SIGPIPE: return "write on pipe with no readers";
  660. #endif
  661. #if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
  662.     case SIGPOLL: return "input/output possible on file";
  663. #endif
  664. #ifdef SIGPROF
  665.     case SIGPROF: return "profiling alarm";
  666. #endif
  667. #if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ))
  668.     case SIGPWR: return "power-fail restart";
  669. #endif
  670. #ifdef SIGQUIT
  671.     case SIGQUIT: return "quit signal";
  672. #endif
  673. #ifdef SIGSEGV
  674.     case SIGSEGV: return "segmentation violation";
  675. #endif
  676. #ifdef SIGSTOP
  677.     case SIGSTOP: return "stop";
  678. #endif
  679. #ifdef SIGSYS
  680.     case SIGSYS: return "bad argument to system call";
  681. #endif
  682. #ifdef SIGTERM
  683.     case SIGTERM: return "software termination signal";
  684. #endif
  685. #ifdef SIGTRAP
  686.     case SIGTRAP: return "trace trap";
  687. #endif
  688. #ifdef SIGTSTP
  689.     case SIGTSTP: return "stop signal from tty";
  690. #endif
  691. #ifdef SIGTTIN
  692.     case SIGTTIN: return "background tty read";
  693. #endif
  694. #ifdef SIGTTOU
  695.     case SIGTTOU: return "background tty write";
  696. #endif
  697. #if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO))
  698.     case SIGURG: return "urgent I/O condition";
  699. #endif
  700. #ifdef SIGUSR1
  701.     case SIGUSR1: return "user-defined signal 1";
  702. #endif
  703. #ifdef SIGUSR2
  704.     case SIGUSR2: return "user-defined signal 2";
  705. #endif
  706. #ifdef SIGVTALRM
  707.     case SIGVTALRM: return "virtual time alarm";
  708. #endif
  709. #ifdef SIGWINCH
  710.     case SIGWINCH: return "window changed";
  711. #endif
  712. #ifdef SIGXCPU
  713.     case SIGXCPU: return "exceeded CPU time limit";
  714. #endif
  715. #ifdef SIGXFSZ
  716.     case SIGXFSZ: return "exceeded file size limit";
  717. #endif
  718.     }
  719.     return "unknown signal";
  720. }
  721.